namespace Columbus.ActionResults
{
    public class CloseDialogResult : ActionResult
    {
        private readonly NavigationContext navigationContext;

        public CloseDialogResult(NavigationContext navigationContext)
            : base(navigationContext)
        {
            this.navigationContext = navigationContext;
        }

        protected override void ExecuteInternal()
        {
            Dispatcher.Dispatch(() =>
            {
                var frame = navigationContext.Navigator.NavigationFrame;

                frame.CloseDialog();
            });
        }
    }
}